package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopMerchantMapper;
import com.ruoyi.system.domain.ShopMerchant;
import com.ruoyi.system.service.IShopMerchantService;

/**
 * 商家信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class ShopMerchantServiceImpl implements IShopMerchantService 
{
    @Autowired
    private ShopMerchantMapper shopMerchantMapper;

    /**
     * 查询商家信息
     * 
     * @param merchantId 商家信息主键
     * @return 商家信息
     */
    @Override
    public ShopMerchant selectShopMerchantByMerchantId(Long merchantId)
    {
        return shopMerchantMapper.selectShopMerchantByMerchantId(merchantId);
    }

    /**
     * 查询商家信息列表
     * 
     * @param shopMerchant 商家信息
     * @return 商家信息
     */
    @Override
    public List<ShopMerchant> selectShopMerchantList(ShopMerchant shopMerchant)
    {
        return shopMerchantMapper.selectShopMerchantList(shopMerchant);
    }

    /**
     * 新增商家信息
     * 
     * @param shopMerchant 商家信息
     * @return 结果
     */
    @Override
    public int insertShopMerchant(ShopMerchant shopMerchant)
    {
        shopMerchant.setCreateTime(DateUtils.getNowDate());
        return shopMerchantMapper.insertShopMerchant(shopMerchant);
    }

    /**
     * 修改商家信息
     * 
     * @param shopMerchant 商家信息
     * @return 结果
     */
    @Override
    public int updateShopMerchant(ShopMerchant shopMerchant)
    {
        return shopMerchantMapper.updateShopMerchant(shopMerchant);
    }

    /**
     * 批量删除商家信息
     * 
     * @param merchantIds 需要删除的商家信息主键
     * @return 结果
     */
    @Override
    public int deleteShopMerchantByMerchantIds(Long[] merchantIds)
    {
        return shopMerchantMapper.deleteShopMerchantByMerchantIds(merchantIds);
    }

    /**
     * 删除商家信息信息
     * 
     * @param merchantId 商家信息主键
     * @return 结果
     */
    @Override
    public int deleteShopMerchantByMerchantId(Long merchantId)
    {
        return shopMerchantMapper.deleteShopMerchantByMerchantId(merchantId);
    }
}
